using logging;

class Base{
    public virtual void show(){
        Log.print("method of Base::show()");
    }

    public virtual void show2(){
        Log.print("method of Base::show2()");
    }

    public void myself(){  // without virtual.
        Log.print("method of Base::myself()");
    }
}

class Derived: Base{
    public override void show(){
        Log.print("method of Derived::show()");
    }

    public void show2(){  // without override, so should use 'new'
        Log.print("method of Derived::show2()");
    }

    public void show3(){  // a new method
        Log.print("A new method of Derived::show3()");
    }

    public void myself(){  // should use 'new'
        Log.print("method of Derived::myself()");
    }


    static void Main(){
#if BASE
        Base t = new Derived();
#else
        var t = new Derived();
#endif
        Base b = t;
        b.show();
        b.show2();
        // b.show3();  // fail to compile for BASE
        b.myself();
    }
}
